﻿function wSelect()
{
	var select;

	var _wSelect =
	{
		load: function(settings)
		{
			SSVC.Wrap.Dojo.Require(["dijit/form/Select", "dojo/domReady!"], function(Select)
			{
				select = new Select(settings);
			});
		},

		placeAt: function(elem)
		{
			select.placeAt(elem);
		},

		on: function(name, func)
		{
			select.on(name, func);
		},

		getValue: function()
		{
			return select.value;
		},

		getOptions: function()
		{
			return select.options;
		},

		setSelectedOption: function(index)
		{
			select.setValue(select.options[index]);
		}
	};

	return {
		Load: _wSelect.load,

		On: _wSelect.on,

		PlaceAt: _wSelect.placeAt,

		GetValue: function()
		{
			return _wSelect.getValue();
		},

		GetOptions: function()
		{
			return _wSelect.getOptions();
		},

		SetSelectedOption: _wSelect.setSelectedOption
	};
}

SSVC.Wrap.Dojo.SetObject("SSVC.Wrap.Dojo.Form.Select", wSelect);